package com.org.example.demo.flinkcdc;

import lombok.extern.slf4j.Slf4j;
import org.apache.flink.streaming.api.functions.sink.SinkFunction;

/**
 * @Description: 数据处理
 **/
@Slf4j
public class DataChangeSink implements SinkFunction<DataChangeInfo> {

    @Override
    public void invoke(DataChangeInfo value, Context context) throws Exception {
        if(value.getEventType() == 1){
            log.info("新增数据:{}", value);
        }else if (value.getEventType() == 2){
            log.info("修改数据:{}", value);
        }
        //业务代码
    }
}

